#ifndef SOCKETHANDLER_H
#define SOCKETHANDLER_H

#define SERVERSOCKET_STANDART_PORT 9001

#include <QObject>
#include <QTcpServer>
#include "console.h"

class Console;
class ClientManager;
class ServerSocket;
class SQLConnection;
class SocketHandler : public QObject
{
    Q_OBJECT

public:
    SocketHandler(QObject *parent = 0);
    ~SocketHandler();
    void run();

private slots:
    void sendWelcome();
    void sendMessageToAll(const QString &from, const QString &message);

private:
    ClientManager *m_clientManager;
    QTcpServer *m_serverSocket;
    Console m_console;
};

#endif // SOCKETHANDLER_H
